function [scheduledTargets, status] = GRASP_Schedule2(PQ, s1OlTargets, s1OlBins, s2OlTargets, s2OlBins, max_iterations)
%GRASP_Schedule Summary of this function goes here
%   Detailed explanation goes here

bestScheduledTargets = [];
bestScheduledPriorities = [];
status = 0;

for k = 1:max_iterations
  scheduledTargets = [];
  scheduledPriorities = [];
  
  [scheduledTargets, scheduledPriorities, status] = GRASP_Construction(PQ, s1OlTargets, s1OlBins, s2OlTargets, s2OlBins, scheduledTargets, scheduledPriorities);
  if ~status
    continue;
  end
  
  [scheduledTargets, scheduledPriorities, status] = GRASP_LocalSearch2(PQ, s1OlTargets, s1OlBins, s2OlTargets, s2OlBins, scheduledTargets, scheduledPriorities);
  if ~status
    continue;
  end
  
  [bestScheduledTargets, bestScheduledPriorities, status] = GRASP_UpdateSolution2(PQ, bestScheduledTargets, bestScheduledPriorities, scheduledTargets, scheduledPriorities);
  if ~status
    continue;
  end
end

if ~status
  scheduledTargets = [];
else
  %[s1OlTargets; s1OlBins]
  %[s2OlTargets; s2OlBins]
  scheduledTargets = ST_TrimZeroes(bestScheduledTargets);
  status = GRASP_CheckSolution(scheduledTargets, s1OlTargets, s1OlBins);
  if ~status
    scheduledTargets = [];
  end
  status = GRASP_CheckSolution(scheduledTargets, s2OlTargets, s2OlBins);
  if ~status
    scheduledTargets = [];
  end
end
end %function